clear
tempfile results
foreach xxx in 	30_15 60_30 180_60 300_180 600_300 900_600{
	clear
	use "cleandata\winprob_matched_dataset`xxx'"
	
	
	gen prev_check=strpos(prev_move,"+")>0
	gen prev_capture=strpos(prev_move,"x")>0
	
	keep if winprob!=. & timetaken!=. & timecontrol_iv!=. & size_match==2
	
	reghdfe piecesonboard timecontrol_iv, absorb(matchvar) cluster(matchvar)
	est sto piecesonboard`xxx'
	reghdfe prev_check timecontrol_iv, absorb(matchvar) cluster(matchvar)
	est sto prev_check`xxx'
	
	reghdfe prev_capture timecontrol_iv, absorb(matchvar) cluster(matchvar)
	est sto prev_capture`xxx'
		
}
label var timecontrol_iv "Lower Time Control"

esttab piecesonboard* using "exhibits/balance_pieces.tex", tex replace se mtitle("30 sec" "1 min" "3 min" "5 min" "10 min" "15 min") label note("Standard errors clustered by matched pair")
esttab prev_check* using "exhibits/balance_checks.tex", tex replace se mtitle("30 sec" "1 min" "3 min" "5 min" "10 min" "15 min") label nonotes
esttab prev_capture* using "exhibits/balance_captures.tex", tex replace se mtitle("30 sec" "1 min" "3 min" "5 min" "10 min" "15 min") label nonotes

